home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.direct.ca!usenet
- From: etoivane@direct.ca (Ed Toivanen)
- Newsgroups: comp.lang.c
- Subject: Re: File Based linked list
- Date: 25 Feb 1996 21:12:30 GMT
- Organization: Your Organization
- Message-ID: <4gqjbu$jno@aphex.direct.ca>
- References: <Pine.SOL.3.90.960219171637.21117B-100000@eddie>
- NNTP-Posting-Host: 204.174.243.150
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
-
- > Anyone know how to write a file based linked list... How
- >different is it to implement then a regular memory based linked list??
- >Any source code would be greatly appriciated... BTW I am a student and I
- >need it for an assignment...
-
- Sound like we have the same assignment! We just had an assignment at BCIT
- where we stored an array of indexes of structures to a file. The fields of the
- struct were the name, and file position of the record in the data file. The
- new assignment is to convert to linked lists. The data file will naturally
- remain unchanged, but the index file will run this way: Create a new element,
- copy the next struct (i*structSize) into the linked list from the index file,
- repeat if necessary! At the end of execution, rewrite the index file with the
- updated index, one struct at a time. BTW do all the i/o in binary mode, as
- life will be much simpler. I'll post the necessary code, once it's written.
-
- C ya later, Ed
-
-